package com.easyadmin.modules.stock.controller;


import com.easyadmin.common.web.base.BaseController;
import com.easyadmin.common.web.domain.request.PageDomain;
import com.easyadmin.common.web.domain.response.module.ResultTable;
import com.easyadmin.modules.stock.domain.SysStockPriceWarnEntity;
import com.easyadmin.modules.stock.domain.SysStocksDayPrice;
import com.easyadmin.modules.stock.service.SysStockPriceWarnService;
import com.easyadmin.modules.stock.service.SysStocksDayPriceService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

/**
 * 股票价格预警表
 *
 * @author wanzenghui
 * @email lemon_wan@aliyun.com
 * @date 2025-04-03 20:54:57
 */
@RestController
@RequestMapping("/stock/fprice")
public class SysStocksDayPriceController extends BaseController {


    @Autowired
    private SysStocksDayPriceService sysStocksDayPriceService;



    /**
     * Describe: 基础路径
     */
    private static String MODULE_PATH = "stock/fprice/";



    /**
     * Describe: 获取列表视图
     * Param ModelAndView
     * Return 列表视图
     */
    @GetMapping("main")
    @ApiOperation(value = "获取列表视图")
    @PreAuthorize("hasPermission('/stock/fprice/main','stock:fprice:main')")
    public ModelAndView main() {
        return jumpPage(MODULE_PATH + "main");
    }



    /**
     * 分页查询    审核通过的
     */
    @ResponseBody
    @GetMapping("/list")
    @PreAuthorize("hasPermission('/stock/fprice/list','stock:fprice:list')")
    public ResultTable alist(@ModelAttribute SysStocksDayPrice sysStocksDayPrice, PageDomain pageDomain) {
        PageInfo<SysStocksDayPrice> pageInfo = sysStocksDayPriceService.queryPage(sysStocksDayPrice, pageDomain);
        return pageTable(pageInfo.getList(), pageInfo.getTotal());
    }
}
